import 'package:abc/view/CustomAppBar.dart';
import 'package:abc/view/GradientButton.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class PublishSuccessPage extends StatelessWidget {
  const PublishSuccessPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFF0E0F26), // 深色背景
      appBar: CustomAppBar(
        title: "提交成功",
        onBack: () {
           Get.back(result: 1);
        },
      ),
      body: _buildSuccessCard(context),
    );
  }

  Widget _buildSuccessCard(BuildContext context) {
    return Container(
      margin: const EdgeInsets.only(left: 16, right: 16, top: 9),
      padding: const EdgeInsets.symmetric(vertical: 32),
      decoration: BoxDecoration(
        color: Color(0x33959595),
        borderRadius: BorderRadius.circular(16),
      ),
      child: Column(
        mainAxisSize: MainAxisSize.min, // 确保卡片只占用所需空间
        children: <Widget>[
          Image.asset('assets/images/ic_post_suc.png', width: 125, height: 125),
          const SizedBox(height: 32),

          const Text(
            '您的帖子已经成功提交',
            style: TextStyle(
              color: Colors.white,
              fontSize: 18,
              fontWeight: FontWeight.bold,
            ),
          ),
          const SizedBox(height: 5),
          const Text(
            '请耐心等待审核',
            style: TextStyle(
              color: Colors.white,
              fontSize: 18,
              fontWeight: FontWeight.bold,
            ),
          ),
          const SizedBox(height: 12),

          // 3. 进度查看提示
          Text(
            '您可以在「我的」-「我的帖子」查看审核进度',
            style: TextStyle(
              color: Color(0xFF92929D),
              fontSize: 13,
              fontWeight: FontWeight.w400,
            ),
          ).paddingSymmetric(vertical: 10),
          const SizedBox(height: 32),

          // 4. 确认按钮
          GradientButton(
            text: '返回社区',
            margin: EdgeInsetsGeometry.symmetric(horizontal: 107),
            onPressed: () => Get.back(result: 1),
          ),
        ],
      ),
    );
  }
}
